﻿using System;
using System.Text;
using System.Windows;

namespace Automator.Windows
{
    public partial class ExceptionWindow : Window
    {
        public ExceptionWindow(Exception ex)
        {
            InitializeComponent();
            
            StringBuilder sb = new StringBuilder();
            sb.Append(ex.ToString());
            edtTrace.Text = sb.ToString();
        }
        
        private void BtnContinue_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
        
        private void BtnShutdown_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
            Application.Current.Shutdown();
        }
        
        private void BtnCopy_Click(object sender, RoutedEventArgs e)
        {
            Clipboard.SetText(edtTrace.Text, TextDataFormat.Text);
        }
    }
}
